<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('ita_to_mysql')) 
{
	/**
	 * ita_to_mysql
	 * 
	 * Transform mm/dd/yyyy to yyyy-mm-dd format
	 * 
	 * @access public
	 * @param string
	 * @return string
	 */
	function ita_to_mysql($ita) 
	{
		if (empty($ita)) return '0000-00-00';
		
		$a_ita = explode('/', $ita);
		
		return $a_ita[2] .'-'. $a_ita[0] .'-'. $a_ita[1];
	}
}

if ( ! function_exists('pdate'))
{
	/**
	 * pdate
	 * 
	 * Returns current timestamp in mysql datetime format
	 * 
	 * @access public
	 * @param void
	 * @return string
	 */
	function pdate()
	{
		return date('Y-m-d H:i:s');
	}
}

/* End of file MY_date_helper.php */
/* Location: ./application/helpers/MY_date_helper.php */
